package user;

import operation.*;
import staff.StaffList;
import java.util.Scanner;
public class User {
    protected IOperation[] iOperations;

    public User() {
        iOperations = new IOperation[]{
                new AddOperation(),new ModifyOperation(),new DelOperation(),new FindOperation(),
                new DisplayOperation()};
    }

    public int menu(){
        System.out.println("======员工基本信息 菜单=====");
        System.out.println("0.员工基本信息的 录入");
        System.out.println("1.员工基本信息的 修改");
        System.out.println("2.员工基本信息的 删除");
        System.out.println("3.员工基本信息的 查询");
        System.out.println("4.员工基本信息的 显示");
        System.out.println("======================");

        Scanner scanner = new Scanner(System.in);
        int choice = scanner.nextInt();
        return choice;
    }
    public void doIOperation(int choice, StaffList staffList){
        this.iOperations[choice].work(staffList);
    }
}
